<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.model.User"%>
<%@page import="com.is.util.ParamUtil"%>
<%@page import="java.util.Collection"%>
<%@page import="com.is.model.AttendanceTime"%>
<%@page import="java.util.List"%>
<%@page import="com.is.control.AttendanceTimeControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/InterStu/resources/image/favicon.ico" />
<link rel="stylesheet" type="text/css" href="../../resources/css/all.css" />
<link rel="stylesheet" type="text/css" href="../../resources/css/add.css" />
<script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
<script type="text/javascript" src="../../resources/js/WebCalendar.js"></script>
<link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resources/js/jquery.artDialog.js"></script>
<script type="text/javascript" src="../../resources/js/iframeTools.js"></script>
<script type="text/javascript">
	$(function(){
		var block = $("#magic_block");
		if($(".active a").position()){
			block.css("top",$(".active a").position().top+10)
			.data("oriTop",$(".active a").position().top)
		}
		$(".nav ul li").find("a").hover(
			function(){
				var $this = $(this);
				var newTop = $this.position().top;
				block.stop().animate({
					top:newTop+10
				})
			},
			function(){
				block.stop().animate({
					top:block.data("oriTop")+10
				})
			}
		)
		var h = $(".right").height();
		$(".left").height(h);
		$(".update").click(function(){
			$.dialog.open("/InterStu/update_info.jsp",{width:460,height:400,title:"个人信息"});
		})
		$('img').error(function(){
			this.src = "/InterStu/resources/image/man.GIF";
		})
	})
</script>
<title>留学生预科班</title>
</head>
<body>
<%
		User cu = (User)session.getAttribute("user");
%>
<div class="header">
	<div class="title pr">
    	<a href="javascript:void(0);"><span class="update pa">个人信息</span></a>
        <span class="logout pa"><a class="hide" href="/InterStu/login/logout.jsp">退出</a></span>
    </div>
</div>
<div class="main">
	<div class="left">   
		<div class="infomation">
			<div class="photo">
			<%
			String picUrl = cu.getPicUrl();
			if(session.getAttribute("picUrl")!=null){
			    picUrl = "/InterStu/User/UserHeadImage/"+(String)session.getAttribute("picUrl");
			}	
			//System.out.print(picUrl);
			%>
				<img width='60' height="60" src = "<%=picUrl %>"  />
			</div>
			<div class="welcome">
				<%=cu.getName() %>,<br/>
				欢迎您使用！
			</div>
		</div>   	
    	<div class="nav">
        	<ul>	
        		<li class="pa" id="magic_block"></li>
            	<%if(cu!=null&&cu.getRole().equals("1")){ %>
                <li><a href="/InterStu/pages/stuyear/stuyear_start.jsp">新学期设置</a></li>
                <li><a href="/InterStu/pages/users/user_all.jsp">用户管理</a></li>
                <%} %>
                <li class="active"><a href="/InterStu/pages/students/student_add.jsp">学生管理</a></li>
                <li><a href="/InterStu/pages/dictation/dictation_add.jsp">学生考核</a></li>
                <%if(cu!=null&&cu.getRole().equals("1")){ %>
                <li><a href="/InterStu/pages/assess/teacher_assess.jsp">教职人员管理</a></li>
                <%} %>
            </ul>
        </div>
    </div>
    <div class="right">
    	<div class="r1">
    	<table class="student tab">
    <tr>
    <%if(cu!=null&&cu.getRole().equals("1")){ %>
    	<td>
    		<a href="/InterStu/pages/students/student_add.jsp">添加学生</a>
		</td>
		<%} %>
		<td>
			<a href="/InterStu/pages/students/student_admin.jsp">查看学生</a>
		</td>
		<td>
			<a class='current' href="/InterStu/pages/attendance/attendance_add.jsp">学生出勤</a>
		</td>
    </tr>
    </table>
	    </div>
	    <div class="r2">
<%
              int defaultCCID = 0;
              if(session.getAttribute("ccid")!=null){defaultCCID=(Integer)session.getAttribute("ccid");}
              int courseClassId =ParamUtil.getInt(request,"courseClassId",defaultCCID);
              if(courseClassId>0){
            	      session.setAttribute("ccid", courseClassId);
		              String time = ParamUtil.getString(request,"time");
		          	  int pages = ParamUtil.getInt(request,"pages",1);
					  int rowsPerPage = ParamUtil.getInt(request, "pageSize", 10);
		              List<AttendanceTime> timeList = (List)AttendanceTimeControl.getAllAttendanceTime(courseClassId,time,pages,rowsPerPage);
		              if(timeList.size()>0){
		  %>
		  <form></form>
		  <form>
		  <table class="table">
		   <caption class="pr">学生出勤情况详细信息<span class="print pa"><a href="attendance_statistics.jsp">返回</a></span></caption>
		  <tr>
			  <th>点名时间</th>
			  <th>操作</th>
		  </tr>
		 <%
		                       for(AttendanceTime dt:timeList){
		  %>
		                             <tr>
		                                <td><%=dt.getTime() %></td>
		                                <td><a href="showOnceTime.jsp?dt=<%=dt.getId() %>">查看详细</a> | <a onclick="return confirm('确定删除？')" href="deleteShowOnceTime.jsp?id=<%=dt.getId() %>">删除</a> </td>
		                             </tr>
		                    	   <%
		                       }
		 %>
		  </table>
		 <p class="bar"><% out.print(AttendanceTimeControl.pageInstance.getToolsMenu(pages)); %></p> 
		  </form>
		  <%          	  
		              }else{
		            	  out.print("暂无相关数据");
		              }
              }else{
            	  out.print("暂无相关数据或参数有误");
              }
              
		              
		%>
		</div>
</div>
</div>
<div class="footer">
	<p>版权所有：东北师范大学留学生预科部&nbsp;&nbsp;  蓝旭工作室开发</p>
</div>
</body>
</html>